package day01_07.day01;
/**
 * 组队竞赛
 * https://www.nowcoder.com/questionTerminal/6736cc3ffd1444a4a0057dee89be789b?orderByHotValue=1&page=1&onlyReference=false
 */
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;

public class Main01 {
    public static void main(String[] args){
        Scanner scn = new Scanner(System.in);

        while (scn.hasNextInt()){
            int n = scn.nextInt();
            long[] array = new long[3 * n];
            for (int i = 0 ; i < array.length; i ++ ){
                array[i] = scn.nextLong();
            }
            Arrays.sort(array);
            long num = 0;
            for (int i = 0; i < n; i++) {
                num += array[array.length - 2 * (i + 1)];
            }
            System.out.println(num);
        }
    }
}
/**
 * 前面取一个，后面取两个，保证中位数相加最大
 */